import React, { Component } from 'react'
import { View, Text, Image } from '@tarojs/components'
import { AtSearchBar, AtList, AtListItem } from 'taro-ui'
import Taro from '@tarojs/taro'
import './hostText.less'

class hostText extends Component {
    constructor(props) {
        super(props);
        this.state = {
            hostid:''
        }
    }
    Click(hostid){
       Taro.navigateTo({url:'/pages/host/oneHost'})
    }
    render() {
        return (
            <View>
                {
                    this.props.hotSpotMedicineList.map((hostText, index) => {
                        return (
                            <View onClick={this.Click.bind(this,hostText.hostid)}>
                                <View className='at-row at-col-12'>
                                    <View className='at-col at-col-4'>
                                        <Image
                                            className='hot-item-img'
                                            src='https://taro-ui.jd.com/img/logo-taro.png'
                                        />
                                    </View>
                                    <View className='at-col at-col-8 hot-item-text'>
                                        <AtList hasBorder={false} key={hostText.hostid}>
                                            <AtListItem hasBorder={false} title={hostText.title} note={hostText.text} extraText={hostText.time} />
                                        </AtList>
                                    </View>
                                </View>
                                {
                                    (index + 1) == this.props.hotSpotMedicineList.length ?
                                        <View className='home-hot-least-title'>
                                            <text className='home-hot-least-title-text'>我也是有底线的</text>
                                        </View> : ' '
                                }
                            </View>
                        )
                    })
                }
            </View>
        )
    }
}
hostText.defaultProps = {
    hotSpotMedicineList:[],
    chooseDataType: ''
  };
export default hostText;